Byte4IO
 
 
 Bean Byte4IO
 
General Four-Bytes Input/Output

Typical usage of the bean in user's code.

Typical Usage:

Required bean name is "Bt41".
Some examples of typical usage of this bean are the following:

(1)
The direction of the bean is set to input.

 MAIN.C

void main(void)
{
  /* Wait until "10101010" is on the port 0,
     "01010101" is on the port 1, 
     "00010001" is on the port 2 and
     "11111111" is on the port 3 */
  while( Bt41_GetVal() != 0xFF1155AA );
    :
}

(2)
The direction of the bean is set to output.

 MAIN.C

void main(void)
{
  Bt41_PutVal(0xFF1155AA);
  /* "10101010" is on the port 0,
     "01010101" is on the port 1, 
     "00010001" is on the port 2 and
     "11111111" is on the port 3 */
  
  for (;;) {
  /* Invert output level of eighth pin on the port 3 */
    Bt41_NegBit(31);
  }
}

(3)
The direction of the bean is set to input/output.

 MAIN.C

void main(void)
{
  Bt41_SetDir(FALSE);  // Set input mode

  /* Wait until "0xFFFFFFFF" is on the ports */
  while( Bt41_GetVal() != 0xFFFFFFFF );
  
  Bt41_SetDir(TRUE);   // Set output mode

  Bt41_PutVal(0);      // Set "0x00000000" on the ports
}

For more about typical usage of the bean code please refer to the page Bean Code Typical Usage.


Processor ExpertTM and Embedded BeansTM are registered trademarks of UNIS, Ltd.
©1997-2005, UNIS, Ltd.